package net.dodoman;

public class InnerMain {

	private static final boolean FLAG = true;

	public static void main(String[] args) {
		IInner1 inner1 = testInner1(FLAG);
		inner1.innerMethod1();
		IInner2 inner2 = testInner2(FLAG);
		inner2.innerMethod2();
	}

	private static IInner1 testInner1(boolean flag) {
		if (flag) {
			class MyInner implements IInner1 {
				public String a, b;

				public void innerMethod1() {
					this.a = "a";
					this.b = "b";
					System.out.println(this.a + this.b);
				}

				public String doSth() {
					return "1111";
				}
			}
			return new MyInner();
		}
		return null;
	}

	private static IInner2 testInner2(boolean flag) {
		if (flag)
			return new IInner2() {
				public void innerMethod2() {
					System.out.println("innerMethod2");
				}
			};
		return null;
	}
}

interface IInner1 {
	void innerMethod1();

	static class abc {
		void doSth() {
			System.out.println("sth");
		}
	}
}

interface IInner2 {
	void innerMethod2();
}